package com.zxg.zbc.biz.util;

/**
 * configs about api
 * 
 */
public class ApiConfigs {

  public static String LUOSIMAO_API_URL = "https://captcha.luosimao.com/api/site_verify";
  public static String LUOSIMAO_API_KEY = "8b4e64c68d52f9020085e26632c9600d";

  public static class Status {
    public final static Integer DELETE       = -1;
    public final static Integer UNUSED       = 0;
    public final static Integer NORMAL       = 1;
    public final static Integer WEEK_BILLING = 2; // 周订单量，待审核
  }

  public static class RoleType {
    public static int ADMIN  = 1;
    public static int SELLER = 2; // 商家
    public static int BUYER  = 4; // 广告主 买家
    public static int OTHER  = 8;
  }

  /**
   * 换包裹任务状态
   */
  public static class ActivityStatus {
    public final static Integer OFFLINE   = -1;
    public final static Integer EDITING   = 0; // 编辑中
    public final static Integer PUBLISHED = 1; // 已发布
    public final static Integer EXECUTING = 2; // 认领完毕，执行中
    public final static Integer FINISHED  = 4; // 任务已完成
  }

  public static class ActivityDetailStatus {
    public final static Integer CLAIMED         = 0; // 已认领，等待接收物料
    public final static Integer MATERIEL_SENDED = 1; // 物料已发货，请收货
    public final static Integer RECEIVED        = 2; // 已收货，正在执行
    public final static Integer FINISHED        = 4; // 已完成
  }

  public static String ALIPAY           = "支付宝";
  public static String PLATEFORM        = "平台";

  public static double TIXIAN_RATIO     = 0.01; // 提现费率
  public static double TASK_JINBI_RATIO = 0.3;  // 领取任务的金币费率 30%

  public static class BalanceType {
    public static int    YU_E        = 1;    // 余额
    public static String YU_E_NAME   = "余额";

    public static int    JIN_BI      = 2;    // 金币
    public static String JIN_BI_NAME = "金币";

    public static int    VIP         = 3;    // 会员
    public static String VIP_NAME    = "会员"; // 余额
  }

  public static class BalanceFlowType {
    public static int IN          = 1; // 入账
    public static int OUT         = 2; // 出账
    public static int IN_FROZEN   = 3; // 入账冻结
    public static int OUT_FROZEN  = 4; // 出账冻结
    public static int TI_XIAN     = 5; // 提现
    public static int TI_XIAN_SXF = 6; // 提现手续费
    public static int JIN_BI_SXF  = 7; // 金币手续费
    public static int VIP_REWARD  = 8; // 邀请用户充会员奖励
  }

  public static class BalanceStatus {
    public static int FAILURE = -1; // 失败
    public static int WAITING = 0;  // 待入账
    public static int SUCCESS = 1;  // 成功
  }

  public static class VIP {
    public static final int TRUE  = 1;
    public static final int FALSE = 0;
  }

  public static class LEAF {
    public static final int TRUE  = 1;
    public static final int FALSE = 0;
  }

  public static class ReviewType {
    public static final int FAILURE = -1; // 审核未通过
    public static final int WAITING = 0;  // 待审核
    public static final int PASSED  = 1;  // 审核通过
  }

  public static class ArticleStatus {// -1已删除；0编辑中；1已发布
    public final static Integer DELETE  = -1;
    public final static Integer EDITING = 0;
    public final static Integer POSTED  = 1;
  }

  // 1天猫店铺；2淘宝店铺；3京东;
  public static class StoreType {
    public final static Integer TMALL  = 1;
    public final static Integer TAOBAO = 2;
    public final static Integer JD     = 3;
  }

  public static final String LOGIN_URL              = "/account/login.htm";
  public static final String NOPERMISSION           = "/nopermission.htm";

  public static String       APP_KEY                = "21781051";
  public static String       APP_SECRET             = "62ef55f9728e083fe07f1db0671f74b1";
  public static String       APP_INDEX_URL          = "http://tbsmt.woyaolai.com/tbsmt";
  public static String       APP_ARTICLE_CODE       = "FW_GOODS-1908701";

  public static String       SUB_USER_OAUTH_URL     = "http://mai.taobao.com/subaccount/employee/role_detail.htm";

  public static String       CODE_URL               = "https://oauth.taobao.com/authorize?response_type=code&client_id=%s&redirect_uri=%s&state=%s&scope=%s&view=%s";
  public static String       TOKEN_URL              = "https://oauth.taobao.com/token";

  public static String       TAOBAO_URL             = "http://container.api.taobao.com/container?encode=utf-8&appkey=" + APP_KEY;
  public static String       API_TAOBAO_URL         = "http://gw.api.taobao.com/router/rest";

  public static String       CODE_URL_SANDBOX       = "https://oauth.tbsandbox.com/authorize?response_type=code&client_id=%s&redirect_uri=%s&state=%s&scope=%s&view=%s";
  public static String       TOKEN_URL_SANDBOX      = "https://oauth.tbsandbox.com/token";

  public static String       TAOBAO_URL_SANDBOX     = "http://container.api.tbsandbox.com/container?encode=utf-8&appkey=" + APP_KEY;
  public static String       API_TAOBAO_URL_SANDBOX = "http://gw.api.tbsandbox.com/router/rest";

  public static String       TAOBAO_ITEM_URL        = "http://item.taobao.com/item.htm?id=";

  public static String getServiceUrl() {
    return "http://fuwu.taobao.com/ser/detail.htm?tracelog=yy&service_code=" + APP_ARTICLE_CODE;
  }

  public static class TradeDay {
    public static final int MAX_TRADE_GET             = 89;
    public static final int MAX_TRADE_PROCESS         = 80;
    public static final int MAX_TRADE_ACOOKIE_PROCESS = 7;
  }

  public static class PageSize {
    public static long KEYWORD_RECOMMEND_PAGE_SIZE          = 60;
    public static long ADGROUPS_GET_PAGE_SIZE               = 60;
    public static long ADGROUPS_CAMPCATMATCHS_GET_PAGE_SIZE = 60;
    public static long ITEM_PAGE_SIZE                       = 200L;
    public static int  ITEMS_LIST_PAGE_SIZE                 = 18;
    public static long CRMMEMBER_PAGE_SIZE                  = 80L;
    public static long CUSTBASE_PAGE_SIZE                   = 160L;
    public static long ADGROUPKEYWORDEFFECT_PAGE_SIZE       = 160L;
    public static int  HOT_WORD_PAGE_SIZE                   = 15;
  }

  public enum CheckCodeMsg {

    MOBILE_IS_NULL(0, "用户手机号码为空"),
    MOBILE_USED(1, "手机号已经被占用"),
    MESSAGE_SEND_SUCCESS(2, "短信发送成功"),
    MESSAGE_SEND_FAILURE(3, "短信发送失败"),
    CHECK_CODE_EXPIRE(4, "验证码已过期"),
    CHECK_CODE_ERROR(5, "验证码错误，请检查"),
    SUCCESS(6, "校验成功"),
    USERNAME_EXISTS(7, "用户名已被占用"),
    USERNAME_IS_NULL(8, "用户名为空"),
    PASSWORD_IS_NULL(9, "密码为空"),
    CAPTCHA_IS_ERROR(10, "请先进行人机识别验证"),
    QQ_IS_NULL(11, "QQ号码为空"),
    WX_IS_NULL(12, "微信号码为空"),
    RESET_PASSWORD_FAILURE(13, "重置密码失败");

    private int    code;
    private String msg;

    private CheckCodeMsg(int _code, String _msg) {
      this.code = _code;
      this.msg = _msg;
    }

    public int getCode() {
      return code;
    }

    public void setCode(int code) {
      this.code = code;
    }

    public String getMsg() {
      return msg;
    }

    public void setMsg(String msg) {
      this.msg = msg;
    }

  }

  // -1审核未通过; 0待审核；1审核通过，待付邮费； 2已付邮费，待发货；3已发货
  public enum BillingStatus {

    UN_PASS(-1, "审核未通过"), WAIT(0, "待审核"), PASSED(1, "审核通过，待付邮费"), PAYED(2, "已付邮费，待发货"), SENDED(3, "已发货"), CLOSED(4, "未付邮费，订单关闭");

    private int    code;
    private String msg;

    private BillingStatus(int _code, String _msg) {
      this.code = _code;
      this.msg = _msg;
    }

    public int getCode() {
      return code;
    }

    public void setCode(int code) {
      this.code = code;
    }

    public String getMsg() {
      return msg;
    }

    public void setMsg(String msg) {
      this.msg = msg;
    }

  }

  public enum ResultMessage {

    FAILURE(0, "操作失败"), SUCCESS(1, "操作成功"), YEBZ(2, "余额不足");

    private int    code;
    private String msg;

    private ResultMessage(int _code, String _msg) {
      this.code = _code;
      this.msg = _msg;
    }

    public int getCode() {
      return code;
    }

    public void setCode(int code) {
      this.code = code;
    }

    public String getMsg() {
      return msg;
    }

    public void setMsg(String msg) {
      this.msg = msg;
    }

  }

}
